export default `import axios from 'axios';
import type { FormType } from '@/<%= typePath.replace(/\\.[t|j]s$/, "") %>';

/** <%= name %>分页查询 */
export const getList = (current: number, size: number, params?: Partial<FormType>) => {
  return axios({
    url: '/api/<%= business %>/xxx/page',
    method: 'get',
    params: {
      current,
      size,
      ...params,
    },
  });
};

/** <%= name %>详情 */
export const getDetail = (id: string) => {
  return axios({
    url: '/api/<%= business %>/xxx/get',
    method: 'get',
    params: {
      id,
    },
  });
};

/** <%= name %>新增 */
export const add = (data: FormType) => {
  return axios({
    url: '/api/<%= business %>/xxx/save',
    method: 'post',
    data,
  });
};

/** <%= name %>更新 */
export const update = (data: FormType) => {
  return axios({
    url: '/api/<%= business %>/xxx/save',
    method: 'post',
    data,
  });
};

/** <%= name %>删除 */
export const remove = (ids: string[]) => {
  return axios({
    url: '/api/<%= business %>/xxx/remove',
    method: 'post',
    data: ids,
  });
};
`;
